Repository navigation
Pull requests overview: where the org's pull requests wait, for whom, and whether that's usual - #546
Conversation
…it is The new top-level page (/prs) lists every open pull request in the team's installed repos, people's and CoderHelm's, grouped by who has the next move (you, CoderHelm, a person, machines, done). Each row says the one state the server decided and the sentence of what it needs and from whom, with the rule it comes from. CoderHelm shows with its own hexagon face, an AI label and the person it works for. The detail opens beside the list on a wide screen and over it otherwise (full screen on a phone): the path to merge, the wait ledger and the timeline with CoderHelm's runs folded. Saved views, the scope trail (org, then repo) and the filters live in the address. j and k move, Enter opens, Esc closes, / searches. Long lists draw only the rows near the screen, the list is read again only while the tab is visible, and a backend without the endpoint gets a plain note instead of an error. The shared list grows what the page needed: shapes for statuses (never colour alone), row attributes and an eyebrow line on ListRow, a windowed list hook, and a generic AvatarGroup that AvatarStack now uses.
…pe switcher - The needs sentence sits right under the title, above the metadata, and is never cut: on a phone it wraps and the title gives way instead. - The turn strip wraps its buttons, so every label is whole from 1024 to 1440 wide. - On a phone the saved views are one scrolling row with a fade and a chevron at the edge while more is off screen. - Each step of the org and repo trail is a bordered button that opens the choices at its level; the repo filter in the toolbar it duplicated is gone. - Stacked faces show one initial each, two at most, then "+n".
The phone navigation keeps "pull-requests" as the second place in its bottom bar; the section now uses that key, so the page takes it there when both are in.
- GET /api/prs's backfill shows quietly under the sync time while an organization's closed and merged pull requests are still being read: "Reading history: 9 of 14 months", with the pause and its reason when there is one, and each repo's count behind a disclosure. Nothing shows when it is done or absent. The wide data answers it, and the spec checks both. - docs: getting-started/pull-requests describes the list (coverage, turn groups, every state with its sentence and the rule behind it, CoderHelm on a row, saved views, the detail, the keyboard, history reading, the phone) with screenshots made from invented data.
…one bar's tests with Pull requests in it The phone bar's tests assumed no Pull requests destination; with it, Pull requests takes the second place and Security moves into the Menu sheet. An alert's Pull request link is matched exactly, so the menu's Pull requests entry isn't taken for it.
| <Page testId="prs-overview" className="!max-w-[90rem]"> | ||
| {header} | ||
| <Controls data={data} params={params} onPick={(p) => setParams(p)} /> | ||
| {error && !data ? ( |
There was a problem hiding this comment.
💬 FYI: A failed or slow scope change shows the previous scope's numbers under the new scope's name (bug, not verified)
The page renders {error && !data ? <ListError/> : loading && !data ? <skeleton/> : data ? <OverviewBody/>}. data is never cleared when the org, repo or window changes. After the user picks another repo, load() sets loading and keeps the old data, so the old payload stays on screen. If that request fails, setError is set but error && !data is false, so the error panel never shows. The page then shows the previous scope's payload with the new repo's title, since header and scope come from params.repo. Every link in the page is also built from the new scope. The same mismatch appears while the request is in flight, because there is no skeleton either. Retry is unreachable in that state. Fix: drop data when the scope params change, or store the scope the payload was fetched for and treat a mismatch as no data. Add an e2e case where a repo switch returns 500 and asserts the error and retry appear and the old numbers don't.
FYI, not a block: on the whole picture this is not a named correctness, security or data-loss problem to hold the merge on.
| onChange={(v) => onPick({ repo: v === "__all" ? "" : v, org })} | ||
| options={[ | ||
| { value: "__all", label: `Repos: all ${data?.scope.repos ?? ""}`.trim() }, | ||
| ...(params.repo && !repos.includes(params.repo) ? [params.repo] : repos).map((r) => ({ value: r, label: r })), |
There was a problem hiding this comment.
💬 FYI: Repo picker drops every other repo when the selected repo isn't in the loaded list (bug, not verified)
...(params.repo && !repos.includes(params.repo) ? [params.repo] : repos) replaces the whole option list with just the selected repo. That happens on a deep link to a repo the payload doesn't list, or while the previous scope's data is still showing. The user can then only choose that repo or 'all'. The likely intent is to prepend the missing repo and keep the rest.
FYI, not a block: on the whole picture this is not a named correctness, security or data-loss problem to hold the merge on.
| ...(params.repo && !repos.includes(params.repo) ? [params.repo] : repos).map((r) => ({ value: r, label: r })), | |
| ...(params.repo && !repos.includes(params.repo) ? [params.repo, ...repos] : repos).map((r) => ({ value: r, label: r })), |
| /** On a phone, one line per repo. */ | ||
| function RepoRows({ o, scope }: { o: PrsOverview; scope: Scope }) { | ||
| return ( | ||
| <Card id="repos" testId="overview-repos" title="Repos"> |
There was a problem hiding this comment.
💬 Suggestion: Desktop and phone trees are both mounted, so ids repeat (hardening)
OverviewBody renders the desktop block (hidden sm:block) and the phone block (sm:hidden) together and hides one with CSS. RepoTable uses Card id="repos" (line 598) and RepoRows uses Card id="repos" (line 705). Strip renders twice with the same id="strip-heading" and testId="overview-strip". Duplicate ids are invalid HTML. An in-page #repos anchor lands on the first, hidden, copy on a phone. Test locators on these testids also match two elements. Consider giving the phone copies distinct ids, or rendering only one tree based on a media query.
This blocks: Duplicate ids on the main rendered page are invalid HTML and break in-page anchors and test locators, shown at specific lines on the change's main path
|
|
||
| /** Notable events this week, each kind behind its floor; at most eight, filterable by kind. */ | ||
| export function EventsPanel({ o, scope }: { o: PrsOverview; scope: Scope }) { | ||
| const [kind, setKind] = useState(""); |
There was a problem hiding this comment.
💬 Suggestion: A chosen event kind can outlive the data, leaving an empty list with no way to reset (bug, not verified)
kind is local state. The Select is only rendered when kinds.length > 1. If a later read (the poll, or a scope change that doesn't remount the panel) leaves one kind or none, the old kind stays set. shown is then empty and the panel says 'Nothing notable' while events may exist, and the Select that could clear it is gone. Resetting kind when it is no longer in kinds would fix it, for example by treating an unknown kind as ''. I did not confirm whether the page remounts the panel on a scope change.
| const [kind, setKind] = useState(""); | |
| const [picked, setKind] = useState(""); |
| approved: "Approved, not merged", | ||
| }; | ||
|
|
||
| function isStage(v: string): v is PrStage { |
There was a problem hiding this comment.
💬 FYI: isStage accepts inherited object keys (bug, not verified)
isStage is v in STAGE_WORDS, and in also matches inherited keys. A URL like /prs?stage=toString or stage=constructor passes the check. It is then sent to the backend as stage, and it makes the chip render STAGE_WORDS[stage], which is a function. The client-side row filter also hides every row that has a stage. Only a hand-edited URL triggers it, so impact is small.
FYI, not a block: on the whole picture this is not a named correctness, security or data-loss problem to hold the merge on.
Source: ECMAScript in operator checks the prototype chain: https://tc39.es/ecma262/#sec-relational-operators
| return v in STAGE_WORDS; | ||
| } | ||
|
|
||
| /** The filters the overview opens the list with, each one clearable. */ |
There was a problem hiding this comment.
💬 Suggestion: The past filter has no client-side fallback (hardening, not verified)
The stage filter is also applied in the browser, so it still works on a backend that ignores it. The past filter is not. On an older backend the chip 'Open past the p85' would show while the list stays unfiltered. Consider showing the chip only when the page response says it was applied, or accept this as a known limit.
| } | ||
|
|
||
| /** "Sun Jan 4": a day with its weekday. */ | ||
| export function dayWords(iso: string | null | undefined): string { |
There was a problem hiding this comment.
💬 FYI: Near-identical helpers added together (scope, not verified)
dashboard/src/app/prs/overview/model.ts adds dayWords next to when, added in the same change. Keep one helper with the shared logic (a parameter for what differs) and call it from both places. If the ticket truly needs it, say why on a line Wider than the ticket: dashboard/src/app/prs/overview/model.ts: <why>.
FYI, not a block: on the whole picture this is not a named correctness, security or data-loss problem to hold the merge on.
|
💚 Post-merge health check passed: the deploy of
|
Summary
Pull requests now opens on an Overview tab, with the per-PR List beside it. One page shows where the org's pull requests wait, for whom, whether that is usual for the org, and what stalled, broke, went unreviewed or is past a deadline. Every number covers every pull request in the installed repos (people's, CoderHelm's, Dependabot's and other bots'). CoderHelm's pull requests are one slice, in their own panel.
The page reads
GET /api/prs/overviewfrom CoderHelm/coderhelm-platform#988 and builds on the List from #544.Screenshots, all invented data (the acme bookstore):
Panels and phone
Changes
Tabs: Overview (
/prs/overview, the default) and List (/prs), using the existing section tabs.Summary:
Strip: six stages with week-over-week change, an 8-week line and past-p85 counts, the whose-turn line, and a condition row (stale, abandoned, zombie, drift, blocked by main). A cell opens the List filtered to it: the List now reads
stage=andpast=and shows them as clearable chips.Aging chart: plain SVG with no new library. One mark per PR: a hexagon for CoderHelm, a circle for people, a square for other bots. Idle PRs are hollow and PRs blocked by a red main are ringed. It draws the p50, p85 and p95 lines with labeled external bands, has drag-to-select with a sentence about what the selection has more of, and a mark click opens the PR's detail.
Repo table: obligations first, with these columns:
A row opens the same overview for that repo, which adds the flow by stage over 12 weeks and a cycle-time scatter.
Panels: Stale, Failures and incidents, Review health, Security and policy, and This week's events.
CoderHelm panel: author, fixer and reviewer outcomes, runs in exactly one end state, and exceptions. No line counts.
Phone: summary first, the strip as a grid, the PRs past usual as a list, one sentence per panel that opens it, then the repos.
States: loading outline, empty, error with retry, the 404 fallback for older backends, "not enough history yet" or "not recorded yet" wherever data isn't there, and backfill progress ("12 of 40 repos read").
Theme: colours are the design system's dark tokens, and every colour is paired with a label or a shape.
Docs:
getting-started/pull-requests-overview. It covers each section, every metric's definition and threshold rule (own-history percentiles, the 30-merge minimum, the 10-event floor), the stale states, the five coverage states, the security deadline defaults, and that digests and nudges are opt-in and not sent yet. It uses screenshots of invented acme data.Verification
npm run lint(UI lint, no hosted links, fixture words),npm run typecheckandnpm run check:openapiall pass.E2E_STATIC=1, the CI setup), after merging main (A Pull requests page: every open pull request, grouped by whose turn it is #544 and On a phone, the dashboard opens on an Inbox of decisions: Inbox, Runs, PRs, Chat and Menu #545): 2,263 passed, 29 skipped. Three tests failed only while a screenshot run shared the test-results folder, and all 39 tests in those specs pass when rerun alone. An earlier full run found five failures, all fixed here:e2e/prs-overview.spec.ts, 20 tests:node --test scripts/prose.test.mjs) pass.